<?php

namespace Tests\XinSheng;

use PHPUnit\Framework\TestCase;
use XinSheng\ModelByIrr;

class TestModelByIrr extends TestCase
{

    public function testGetRent()
    {
        $mbi = new ModelByIrr(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11, 36);
        $rent = $mbi->getRent();
        var_dump($rent);
        self::assertIsFloat($rent);
    }

    public function testGetPlan()
    {
        $mbi = new ModelByIrr(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11, 36);
        $plan = $mbi->getPlan();
        var_dump($plan);
        self::assertIsArray($plan);
        $plan = $mbi->getPlan('2021-05-31');
        var_dump($plan);
        self::assertIsArray($plan);
    }

    public function testGetOutsideRate()
    {
        $mbi = new ModelByIrr(1000000.00, 200000.00, 0.00, 0.00, 20000.00, 0.11, 36);
        $custemerRate = $mbi->getOutsideRate();
        var_dump($custemerRate);
        self::assertIsFloat($custemerRate);
    }
}
